import time

#获取时间戳
start=time.time()
time.sleep(0.1)#睡眠
end=time.time()
print(end-start)

#获取本地时间
t=time.localtime()
print(type(t))
#打印年月日时分秒星期
print(t)
print(f'年:{t.tm_year}')
print(f'月:{t.tm_mon}')

#时间转字符串
str_t=time.strftime("%Y-%m-%d %H-%M-%S",t)
print(str_t)
